package com.smooth.dao.gen;

import com.smooth.dao.gen.bean.BizPic;
import com.smooth.dao.gen.bean.BizPicExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface BizPicMapper {
    /** biz_pic */
    @SelectProvider(type=BizPicSqlProvider.class, method="countByExample")
    long countByExample(BizPicExample example);

    /** biz_pic */
    @DeleteProvider(type=BizPicSqlProvider.class, method="deleteByExample")
    int deleteByExample(BizPicExample example);

    /** biz_pic */
    @Delete({
        "delete from biz_pic",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    /** biz_pic */
    @Insert({
        "insert into biz_pic (id, img_source_url, ",
        "img_resize_url, img_type, ",
        "resize_scal, href_url, ",
        "remark, create_date, ",
        "update_date)",
        "values (#{id,jdbcType=VARCHAR}, #{imgSourceUrl,jdbcType=VARCHAR}, ",
        "#{imgResizeUrl,jdbcType=VARCHAR}, #{imgType,jdbcType=SMALLINT}, ",
        "#{resizeScal,jdbcType=DOUBLE}, #{hrefUrl,jdbcType=VARCHAR}, ",
        "#{remark,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, ",
        "#{updateDate,jdbcType=TIMESTAMP})"
    })
    int insert(BizPic record);

    /** biz_pic */
    @InsertProvider(type=BizPicSqlProvider.class, method="insertSelective")
    int insertSelective(BizPic record);

    /** biz_pic */
    @SelectProvider(type=BizPicSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="img_source_url", property="imgSourceUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="img_resize_url", property="imgResizeUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="img_type", property="imgType", jdbcType=JdbcType.SMALLINT),
        @Result(column="resize_scal", property="resizeScal", jdbcType=JdbcType.DOUBLE),
        @Result(column="href_url", property="hrefUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    List<BizPic> selectByExample(BizPicExample example);

    /** biz_pic */
    @Select({
        "select",
        "id, img_source_url, img_resize_url, img_type, resize_scal, href_url, remark, ",
        "create_date, update_date",
        "from biz_pic",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="img_source_url", property="imgSourceUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="img_resize_url", property="imgResizeUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="img_type", property="imgType", jdbcType=JdbcType.SMALLINT),
        @Result(column="resize_scal", property="resizeScal", jdbcType=JdbcType.DOUBLE),
        @Result(column="href_url", property="hrefUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP)
    })
    BizPic selectByPrimaryKey(String id);

    /** biz_pic */
    @UpdateProvider(type=BizPicSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BizPic record, @Param("example") BizPicExample example);

    /** biz_pic */
    @UpdateProvider(type=BizPicSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BizPic record, @Param("example") BizPicExample example);

    /** biz_pic */
    @UpdateProvider(type=BizPicSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BizPic record);

    /** biz_pic */
    @Update({
        "update biz_pic",
        "set img_source_url = #{imgSourceUrl,jdbcType=VARCHAR},",
          "img_resize_url = #{imgResizeUrl,jdbcType=VARCHAR},",
          "img_type = #{imgType,jdbcType=SMALLINT},",
          "resize_scal = #{resizeScal,jdbcType=DOUBLE},",
          "href_url = #{hrefUrl,jdbcType=VARCHAR},",
          "remark = #{remark,jdbcType=VARCHAR},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(BizPic record);
}